import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'flow/create',
    method: 'post',
    data
  })
}
export function edit(data) {
  return request({
    url: 'flow/create',
    method: 'put',
    data
  })
}
export function deploy(modelId) {
  return request({
    url: 'flow/deployModel/' + modelId,
    method: 'get'
  })
}

export function exportModel(modelId) {
  return request({
    url: 'flow/export/' + modelId,
    method: 'get',
    responseType: 'blob'
  })
}

export function del(modelId) {
  return request({
    url: 'flow/delete/' + modelId,
    method: 'delete'
  })
}

export function delAll(ids) {
  return request({
    url: 'flow/deleteAll/',
    method: 'delete',
    data: ids
  })
}

